home *** CD-ROM | disk | FTP | other *** search
/ Commodore Disk User Volume 3 #7 / Commodore_Disk_User_Vol.3_7_1990_-.d64 / hires animator (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  4KB  |  122 lines

  1. 10 ifa>0then40
  2. 20 poke55,255:poke56,63:poke51,255:poke52,63:clr
  3. 30 a=a+1:print"loading sprites":load"sprite file 1",8,1
  4. 40 ifa>1then60
  5. 50 a=a+1:print"loading m/code ":load"animate.mc",8,1
  6. 60 ifa>2then90
  7. 70 sys 50222:rem clear bit map memory and hires character memory
  8. 80 a=a+1:print"loading hires ch":load"test1      .anm",8,1
  9. 90 gosub 820:rem variables
  10. 100 syscls:syscmem:syssbank:sysschbase
  11. 110 poke53265,peek(53265)or32:rem hires bit map mode
  12. 120 ifpeek(multi)=1thenpoke53270,peek(53270)or16:rem multicolour
  13. 130 poke24568,0:poke24569,8:rem sprite pointers
  14. 140 poke53276,peek(53276)or3:rem multi colour sprite
  15. 150 poke53287,10:poke53285,12:poke53286,5:poke53288,0:rem sprite colour
  16. 160 poke53248,100:poke53249,50:rem x,y co-ordinates
  17. 170 poke53264,peek(53264)or1:rem  msb of sprite 0
  18. 180 poke53269,peek(53269)or3:rem switch on sprites
  19. 190 sysinit:rem set up hires figure on screen
  20. 200 sc=0:db=0
  21. 210 pokemode,108:sysanim
  22. 220 rem main loop
  23. 230 forn=0to320
  24. 240 sx=sx-1
  25. 250 if sx<0and(peek(53264)and1)=1thengosub760
  26. 260 if sx=0and(peek(53264)and1)=0thensx=100:poke53264,1
  27. 270 if db=0thensc=sc+1
  28. 280 if db=1thensc=sc-1
  29. 290 if sc=0thendb=0
  30. 300 if sc=7thendb=1
  31. 310 poke53248,sx:poke24568,sc
  32. 320 nextn
  33. 330 poke53269,0:sysaoff
  34. 340 pokecb,96:pokect,128:syswipe
  35. 350 poke multi,1:pokeabase,0:pokeabase+1,96
  36. 360 k=60
  37. 370 x=1/(NULL):p=0
  38. 380 a=1/sqr(5)
  39. 390 forn=1 to 1000
  40. 400 y=x-.5:x=x+a-int(x+a)
  41. 410 p=p-y
  42. 420 xx=x*319:yy=100-p*k:cc=int(rnd(1)*3+1)
  43. 430 xx=2*int(xx/2):xh=int(xx/256):xl=xx-(xh*256)
  44. 440 pokecolour,cc:pokehx,xl:pokehx+1,xh:pokehy,yy
  45. 450 sysplot
  46. 460 nextn
  47. 470 poke mode,96
  48. 480 gosub670:pv=1:pokepause,pv:pokeyd,0
  49. 490 x1=(peek(px)*8)+60:y1=150:poke53250,x1:poke53251,y1
  50. 500 sx=100:poke53264,1:poke53248,sx:poke53249,120:poke53269,3
  51. 510 sysnanim
  52. 520 sx=sx-1
  53. 530 if sx<0and(peek(53264)and1)=1thengosub760
  54. 540 if sx=0and(peek(53264)and1)=0thensx=100:poke53264,1
  55. 550 if db=0thensc=sc+1
  56. 560 if db=1thensc=sc-1
  57. 570 if sc=0thendb=0
  58. 580 if sc=7thendb=1
  59. 590 ifpeek(fire)=1then650
  60. 600 poke53248,sx:poke24568,sc
  61. 610 x1=(peek(px)*8)+60
  62. 620 ifx1>255thenx1=x1-255:poke53264,peek(53264)or2:poke53250,x1:goto640
  63. 630 ifx1<255thenpoke53264,peek(53264)and253:poke53250,x1
  64. 640 goto510
  65. 650 poke53269,0
  66. 660 end
  67. 670 rem initialise character routine
  68. 680 poke mve,0:poke rile,0
  69. 690 x=8:y=8:rem coordinates (in character blocks) of start position.
  70. 700 pokepx,x:pokepy,y
  71. 710 ss=24576+(320*y):pokehl,int(ss/256):pokell,ss-(peek(hl)*256):rem extreme lhs
  72. 720 pokehr,int((ss+240)/256):pokelr,(ss+240)-(peek(hr)*256):rem extreme rhs
  73. 730 ss=ss+(8*x):pokesvlue+1,int(ss/256):pokesvlue,ss-(int(ss/256)*256)
  74. 740 sys aer
  75. 750 return
  76. 760 rem msb off
  77. 770 sx=255:poke53264,peek(53264)and 254
  78. 780 return
  79. 790 rem msb on
  80. 800 sx(0)=0:poke53264,peek(53264)or1
  81. 810 return
  82. 820 rem initialise variables
  83. 830 sbank=49205:rem set bank
  84. 840 schbase=49224:rem set char.base
  85. 850 rile=49916:rem moving l-r or r-l
  86. 860 mve=49917:rem character move
  87. 870 multi=49152:rem multi colour mode
  88. 880 init=49362:rem initialise hires character routine
  89. 890 anim=49450:rem animation routine
  90. 900 pause=50192:rem slow routine value location
  91. 910 cls=49235:rem set colour memory
  92. 920 cmem=49246:rem clear memory(colour)location
  93. 930 dx=49359:rem direction of x joystick
  94. 940 dy=49360:rem direction of y joystick
  95. 950 fire=49361:rem fire button pressed
  96. 960 ll=49918:rem left hand side lo.byte
  97. 970 lr=49920:rem right hand side lo.byte
  98. 980 hl=49919:rem left hand side hi.byte
  99. 990 hr=49921:rem right hand side hi.byte
  100. 1000 pv=16:rem pause value
  101. 1010 cb=254:rem bottom of memory clear vector hi byte
  102. 1020 ct=50236:rem top of memory hi byte
  103. 1030 px=49924:rem position of x
  104. 1040 py=49925:rem position of y
  105. 1050 yd=49926:rem switch on movement in y axis
  106. 1060 pokeyd,1
  107. 1070 abase=51290:rem hires screen vector
  108. 1080 erase=50981:rem erase hires pixel
  109. 1090 colour=50982:rem multi colour colour
  110. 1100 hx=50983:rem hires pixel x
  111. 1110 hy=50985:rem hires pixel y
  112. 1120 plot=50901:rem plot hires pixel
  113. 1130 wipe=49297:rem clear hires memory
  114. 1140 aoff=49475:rem switch off interrupt driven character
  115. 1150 nanim=49490:rem non interrupt driven hires character
  116. 1160 mode=49711:rem pokemode,108 before using interrupt character otherwise 96
  117. 1170 aloop=49837:rem routine to ex-or 80*96 pixel block of memory
  118. 1180 aste=49890:rem routine to store start variables of block move
  119. 1190 aer=49714:rem routine to set standing figure
  120. 1200 svlue=49912:rem screen position of character.
  121. 1210 return
  122.